package com.itheima.myArray.exception;

public class ArrayException {
    public static void main(String[] args) {

        int[] brr = {11, 22,98, 33, 44};

        /*System.out.println(brr[0]);
        System.out.println(brr[1]);
        System.out.println(brr[2]);
        System.out.println(brr[3]);
        System.out.println(brr[4]);*/

        for (int i = 0; i <= brr.length -1 ; i++) {
            System.out.println(brr[i]);
        }
        System.out.println("======================");
        //快捷键 数组名.fori
        for (int i = 0; i < brr.length; i++) {
            System.out.println(brr[i]);
        }











        // 数组下标索引越界
        int[] arr = new int[3]; // 0 1 2
        System.out.println(arr[0]);    // [0, 数组长度-1]

        // 空指针异常
        arr = null; // 空值, null可以给任意引用数据类型变量进行赋值
        System.out.println(arr[0]);





        String str = new String("abc");
        str = null;
        boolean abc = str.equals("abc");
    }
}
